import {request} from '@/utils/request'

//流程-列表content pageIndex pageSize
export function workflowclassquery(param) {  
  return request({
    url: '/workflowclass/query',
    method: 'post',    
    data: param
  })
}

// 流程-详情 id info": { "id": 7,"code": "编码","name": "名称","note": "描述信息","ord": 1, "state": true
export function workflowclassdetail(param) {
  return request({
    url: '/workflowclass/detail',
    method: 'post',
    data: param
  })
}

//流程-保存 code name state note ord
export function workflowclasssave(param) {
  return request({
    url: '/workflowclass/save',
    method: 'post',
    data: param,
    type: 2
  })
}

//流程-删除 参数 id
export function workflowclassdelete(param) {
  return request({
    url: '/workflowclass/delete',
    method: 'post',
    data: param
  })
}

//流程-版本列表 参数 classId
export function workflowversion(param) {
  return request({
    url: '/workflow/version',
    method: 'post',
    data: param
  })
}

//流程-详情 参数  流程 id  流程类 classId
export function workflowdetail(param) {
  return request({
    url: '/workflow/detail',
    method: 'post',
    data: param
  })
}

//流程-保存 {classId,code,active,version,node:[code,runType],edge:[code,fnodeCode,tnodeCode]}
export function workflowsave(param) {
 // console.log("请求参数："+JSON.stringify(param));
  return request({
    url: '/workflow/save',
    method: 'post',
    data: param,
    type: 2
  })
}

//流程-设置活动版本（参数 id 
export function workflowactive(param) {
  return request({
    url: '/workflow/active',
    method: 'post',
    data: param
  })
}

//流程-删除 参数 id  start 返回 msg success
export function workflowdelete(param) {
  return request({
    url: '/workflow/delete',
    method: 'post',
    data: param
  })
}

//流程节点  参数 classId 
export function workflownode(param) {
  return request({
    url: '/workflow/node',
    method: 'post',
    data: param
  })
}